package com.blocks.blocks;

import com.blocks.ScriptBlocksApplication;
import com.blocks.gui.BlockListGroup;
import com.jme3.math.ColorRGBA;

public class WirelesssTransmitterBlock extends Block {
	
	private static Integer WIRELESS_FREQUENCY = 0;
	
	public WirelesssTransmitterBlock() {	
		super();
	}
	public WirelesssTransmitterBlock(String name, Long masterId) {
		super(name,masterId);
		this.setBlockListGroup(BlockListGroup.FREQUENCY);
	}
	@Override
	public void init() {
		setTextureRow(0.0f);
		setTextureColumn(12.0f);
		super.init();
	}
	@Override
	public void updateLogicalState(float tpf) {
		
		super.updateLogicalState(tpf);
		if(this.isPowered()){			
			ScriptBlocksApplication.getInstance().setWirelessFrequency(WIRELESS_FREQUENCY, this.getFrequency(this.getBlockSides()));
			
		} else {
			setColor(ColorRGBA.Gray);
		}
	}


}
